import axios from "axios";
import { getToken } from "@/utils/auth";

export function downF(url, params) {
  return new Promise((resolve, reject) => {
    axios({
      method: "GET",
      url: process.env.VUE_APP_BASE_HTTP + url,
      params: params,
      responseType: "blob",
      headers: {
        Authorization: "Bearer " + getToken()
      }
    }).then(res => {
      if (res) {
        resolve(res);
      } else {
        reject("error");
      }
    });
  });
}
